<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css" href="js/select2/select2.css" />
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:50px;
		}
	</style>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	
	<div class="container">
		<div class="row">
			<div class="span9">
					<form  id="myform" action="project.jspx?method=new" method="post" class="form-horizontal">
						<fieldset>
						<legend>开始一个新项目</legend>
						<div class="control-group">
							<label class="control-label" for="input01">项目名称</label>
							<div class="controls">
								<input type="text" class="span5" id="input01" name="projectname">
								<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="input01">项目描述</label>
							<div class="controls">
								<textarea  name="content" class="span5"  id="input01" rows="4"></textarea>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="input01">负责人</label>
							<div class="controls">
								<select name="manager" class="multiSelect" style="width:200px">
					                <c:forEach items="${userlist}" var="user">
					                	<option value="${user.id }">${user.username }</option>
					                </c:forEach>
					              </select>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="input01">项目成员</label>
							<div class="controls">
								<select name="member" id="member" multiple class="multiSelect" style="width:500px">
					                <c:forEach items="${userlist}" var="user">
					                	<option value="${user.id }">${user.username }</option>
					                </c:forEach>
					             </select>
							</div>
						</div>
						<input type="hidden" name="members" id="members" />
				          <div class="form-actions">
				            <button type="button" id="btnSave" class="btn btn-primary">保存</button>
				            <button class="btn" onclick="location.back()">返回</button>
				          </div>
						</fieldset>
					</form>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/select2/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".multiSelect").select2();
			
			$("#btnSave").click(function(){
				var v = $("#member").select2("val");
				$("#members").val(v);
				$("#myform").submit();
			});
		});
		
	</script>
</body>
</html>
